#ifndef __CLASSIFIER__
#define __CLASSIFIER__

#include <stdlib.h>
#include <iostream>
#include <vector>
//#include "readFile.h" 

using namespace std;

struct Datum { // the first feature is x_0 = 1
  double* features;
  double output;
  int num_features;
  int label;
};

class Classifier {

public:

  Classifier(int num_f);
  
  ~Classifier();

  void printWeights();

  int getClassOf(Datum d); // d is a set of foot positions, to be classified Y/N.
  
  void train(vector<Datum> data); // data is a vector of training examples

  double h(Datum d);
  
  bool readFile(string file, vector<Datum>* training_data, int num_examples);
  
  bool writeWeightsToFile(string file);

  bool readWeightsFromFile(string file);

 double computeError(vector<Datum>* v, int num_examples);


private:

  double* weights;
  int num_features;

};

#endif
